const express = require('express');
const router = express.Router();
const reminderController = require('../controllers/reminderController');
const { protect } = require('../middleware/authMiddleware');

// 使用授权中间件保护所有提醒相关的路由
router.use(protect);

// 获取提醒列表
router.get('/', reminderController.getReminders);

// 获取今日提醒
router.get('/today', reminderController.getTodayReminders);

// 获取即将到来的提醒
router.get('/upcoming', reminderController.getUpcomingReminders);

// 获取提醒统计
router.get('/stats', reminderController.getReminderStats);

// 获取提醒类型列表
router.get('/types', reminderController.getReminderTypes);

// 创建提醒
router.post('/', reminderController.createReminder);

// 获取提醒详情
router.get('/:id', reminderController.getReminderById);

// 更新提醒
router.put('/:id', reminderController.updateReminder);

// 删除提醒
router.delete('/:id', reminderController.deleteReminder);

// 标记提醒为已完成
router.post('/:id/complete', reminderController.completeReminder);

// 延迟提醒
router.post('/:id/snooze', reminderController.snoozeReminder);

module.exports = router; 